<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="exporter-version" content=mNote Mac 2.4.10"/><meta name="created" content="2013-07-29T14:49:41Z"/><meta name="updated" content="2013-07-29T14:49:41Z"/><title>[翻译完成] 树莓派搭建hadoop集群 - 文盲在编码 - 开源中国社区</title></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 2696px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;">		
      <div style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 57px; margin: 0px 0px 20px; padding: 5px 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;">
        <h1 style="display: block; font-style: normal; font-variant: normal; font-weight: bold; font-size: 27px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 32px; margin: 0px 0px 10px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"><img src="http://files.note.sdo.com/2clrz~kvq11pM718M001Mz" align="absmiddle" style="width: 19px; height: 19px; float: none; background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-size: auto; background-position: 0% 0%; background-repeat: repeat repeat;"> [翻译完成] 树莓派搭建hadoop集群</h1>
        <div style="border: 0px none rgb(102, 102, 102); color: rgb(102, 102, 102); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 15px; margin: 0px; outline: rgb(102, 102, 102) none 0px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;">
    		    		    	    <span style="border: 0px none rgb(102, 102, 102); color: rgb(102, 102, 102); display: block; float: right; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 15px; margin: 0px; outline: rgb(102, 102, 102) none 0px; padding: 0px; text-align: left; text-decoration: none; width: 156px; word-wrap: break-word;">
				

<em style="border: 0px none rgb(170, 0, 0); color: rgb(170, 0, 0); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px 2px; outline: rgb(170, 0, 0) none 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">23</em>人收藏此文章,
<span style="border: 0px none rgb(102, 102, 102); color: rgb(102, 102, 102); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px; outline: rgb(102, 102, 102) none 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">
	<a href="javascript:add_to_favor(144577,3)" title="添加到收藏夹" style="border: 0px none rgb(170, 0, 0); color: rgb(170, 0, 0); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px; outline: rgb(170, 0, 0) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;">我要收藏</a>
</span>			</span>
    		    		发表于昨天(13:39)(2013-07-14 13:39) , 
    		已有<strong style="border: 0px none rgb(170, 0, 0); color: rgb(170, 0, 0); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px 2px; outline: rgb(170, 0, 0) none 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">703</strong>次阅读 ，共<strong style="border: 0px none rgb(170, 0, 0); color: rgb(170, 0, 0); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px 2px; outline: rgb(170, 0, 0) none 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;"><a href="http://my.oschina.net/funnky/blog/144577#comments" style="border: 0px none rgb(170, 0, 0); color: rgb(170, 0, 0); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px; outline: rgb(170, 0, 0) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;">6</a></strong>个评论
    		    	</div> 
      </div>
	  	  	  <div style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 2493px; margin: 0px; overflow: hidden; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"><p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 42px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> Hadoop是由Java实现的, 所以在树莓派上运行就和在其他x86平台上运行一样简单. 首先, 我们需要安装支持树莓派的JVM. 可以选用OpenJDK或者Oracle的JDK 8. 我个人推荐JDK8, 其速度稍微快些, 但是OpenJDK安装<span style="display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">更容易些</span>. </p> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 1. 安装Java </p> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 安装OpenJDK十分简单, 只要执行以下命令 </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 90px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">pi@raspberrypi ~ $ sudo apt-get install openjdk-7-jdk
pi@raspberrypi ~ $ java -version
java version "1.7.0_07"
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1+rpi1)
OpenJDK Zero VM (build 22.0-b10, mixed mode)</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 42px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> <strong style="display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">另外</strong>, 我们可以选择安装Oracle的JDK 8.<br> 可以从这获得:&nbsp;<a href="https://jdk8.java.net/fxarmpreview/index.html" rel="nofollow" style="border: 0px none rgb(68, 102, 187); color: rgb(68, 102, 187); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; outline: rgb(68, 102, 187) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;">https://jdk8.java.net/fxarmpreview/index.html</a> </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 126px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">pi@raspberrypi ~ $sudo tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
pi@raspberrypi ~ $sudo update-alternatives --install "/usr/bin/java" 
"java" "/opt/jdk1.8.0/bin/java" 1 
pi@raspberrypi ~ $ java -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b36e)
Java HotSpot(TM) Client VM (build 25.0-b04, mixed mode)</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 如果你两个都装了, 用以下命令来切换即可: </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 18px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">sudo update-alternatives --config java</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 2. 新增一个hadoop系统用户 </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 54px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">pi@raspberrypi ~ $ sudo addgroup hadoop
pi@raspberrypi ~ $ sudo adduser --ingroup hadoop hduser
pi@raspberrypi ~ $ sudo adduser hduser sudo</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 3. 设置SSH </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 18px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">pi@raspberrypi ~ $ su - hduserhduser@raspberrypi ~ $ ssh-keygen -t rsa -P ""</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 这会生成一个匹配空密码的RSA密钥. 在与其他节点通讯时Hadoop将不再提示输入密码 </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 18px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">hduser@raspberrypi ~$ cat ~/.ssh/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 现在设置<span style="display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">SSH允许</span>用刚生成的密钥访问 </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 18px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">hduser@raspberrypi ~$ ssh localhost</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 现在我们就应该可以不使用密码也可以登录了 </p> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 42px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 4. 安装Hadoop<br> 我们可以从<a href="http://www.apache.org/dyn/closer.cgi/hadoop/core" rel="nofollow" style="border: 0px none rgb(68, 102, 187); color: rgb(68, 102, 187); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; outline: rgb(68, 102, 187) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;">http://www.apache.org/dyn/closer.cgi/hadoop/core</a>下载hadoop </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 90px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">hduser@raspberrypi ~$ wget http://mirror.catn.com/pub/apache/hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.gz
hduser@raspberrypi ~$sudo tar vxzf hadoop-1.1.2.tar.gz -C /usr/local
hduser@raspberrypi ~$cd /usr/local
hduser@raspberrypi /usr/local$ sudo mv hadoop-1.1.2 hadoop
hduser@raspberrypi /usr/local$ sudo chown -R hduser:hadoop hadoop</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 现在hadoop就安装好了. 编译home目录下的.bashrc文件, 将以下内容添加到其中 </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 54px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-armhf
export HADOOP_INSTALL=/usr/local/hadoop
export PATH=$PATH:$HADOOP_INSTALL/bin</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 如果你用的是<span style="display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">oracle的JDK, 相应的修改</span>JAVA_HOME. </p> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 重启一下树莓派来验证安装是否成功: </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 108px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">hduser@raspberrypi ~$ hadoop version
Hadoop 1.1.2
Subversion https://svn.apache.org/repos/asf/hadoop/common/branches/
branch-1.1 -r 1440782
Compiled by hortonfo on Thu Jan 31 02:03:24 UTC 2013
From source with checksum c720ddcf4b926991de7467d253a79b8b</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 42px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 5. 配置Hadoop<br> 注意: 这里的配置是hadoop单节点模式的最低配. </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 18px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">配置文件位于"/usr/local/hadoop/conf/", 我们需要修改core-site.xml, hdfs-site.xml, mapred-site.xml三个文件</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> <strong style="display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">core-site.xml</strong> </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 180px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">&lt;configuration&gt;
&nbsp; &lt;property&gt;
&nbsp;&nbsp;&nbsp; &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;
&nbsp;&nbsp;&nbsp; &lt;value&gt;/fs/hadoop/tmp&lt;/value&gt;
&nbsp; &lt;/property&gt;
&nbsp; &lt;property&gt;
&nbsp;&nbsp;&nbsp; &lt;name&gt;fs.default.name&lt;/name&gt;
&nbsp;&nbsp;&nbsp; &lt;value&gt;hdfs://localhost:54310&lt;/value&gt;
&nbsp; &lt;/property&gt;
&lt;/configuration&gt;</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> <strong style="display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">mapred-site.xml</strong> </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 108px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">&lt;configuration&gt;
&nbsp; &lt;property&gt;
&nbsp;&nbsp;&nbsp; &lt;name&gt;mapred.job.tracker&lt;/name&gt;
&nbsp;&nbsp;&nbsp; &lt;value&gt;localhost:54311&lt;/value&gt;
&nbsp; &lt;/property&gt;
&lt;/configuration&gt;</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> <strong style="display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">hdfs-site.xml</strong> </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 108px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">&lt;configuration&gt;
&nbsp; &lt;property&gt;
&nbsp;&nbsp;&nbsp; &lt;name&gt;dfs.replication&lt;/name&gt;
&nbsp;&nbsp;&nbsp; &lt;value&gt;1&lt;/value&gt;
&nbsp; &lt;/property&gt;
&lt;/configuration&gt;</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 哦了, 即将完工, 还剩最后一步. </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 72px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">hduser@raspberrypi ~$ sudo mkdir -p /fs/hadoop/tmp
hduser@raspberrypi ~$ sudo chown hduser:hadoop /fs/hadoop/tmp
hduser@raspberrypi ~$ sudo chmod 750 /fs/hadoop/tmp
hduser@raspberrypi ~$hadoop namenode -format</pre> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 注意: </p> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 42px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> 如果选用的是JDK 8, 我们需要强制在JVM client模式下<span style="display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">运行<span style="display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; letter-spacing: 1px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;">DataNode</span></span>, 因为JDK 8还不支持server模式. 进入/usr/local/hadoop/bin目录中来编辑hadoop文件(请先备份). 使用nano进行修改的步骤如下:nano hadoop, ctrl-w输入“-server”进行查找. 我们需要删除“-server”这个参数, 然后保存退出就行了. </p> 
<p style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 21px; font-family: Verdana, sans-serif, 宋体; height: 21px; letter-spacing: 1px; margin: 0px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;"> hadoop单节点系统就算是搭建完成了. 下面给一些有用的命令. </p> 
<pre style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(246, 246, 246); background-size: auto; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: 'Courier New', Arial; height: 54px; margin: 10px 0px; padding: 5px; text-align: left; text-decoration: none; white-space: pre; width: 1041.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">1. jps           // 输出本地VM标识符
2. start-all.sh  // 启动所有hadoop进程
3. stop-all.sh   // 停止所有hadoop进程</pre> 
<span style="display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px; padding: 0px; text-align: left; text-decoration: none; word-wrap: break-word;"></span></div>
      	  	  
            <div style="margin: 10px 0px 0px; display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 0px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;">
		
      </div>
	  	
	  	  
      <div style="background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgb(255, 255, 238); background-size: auto; border: 1px solid rgb(221, 221, 221); color: rgb(102, 102, 102); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 15px; margin: 20px 0px; outline: rgb(102, 102, 102) none 0px; padding: 5px; text-align: left; text-decoration: none; width: 1045.96875px; word-wrap: break-word; background-position: 0% 0%; background-repeat: repeat repeat;">		
	  		声明：OSCHINA 博客文章版权属于作者，受法律保护。未经作者同意不得转载。
	  	  </div>

      <div style="display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 49px; margin: 10px 0px 20px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word;">
    	<ul style="display: block; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 24px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; width: 1057.96875px; word-wrap: break-word; list-style: none outside none;">
                <li style="display: list-item; float: left; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 15px; margin: 0px; padding: 0px; text-align: left; text-decoration: none; width: 507.8125px; word-wrap: break-word; list-style: none outside none;"><a href="http://my.oschina.net/funnky/blog/142067" title="上一篇：[翻译完成] 树莓派搭建Google TV" style="border: 0px none rgb(68, 102, 187); color: rgb(68, 102, 187); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px; outline: rgb(68, 102, 187) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;">« [翻译完成] 树莓派搭建Google TV</a></li>            	</ul>
				<p style="margin: 10px 0px 0px; font-weight: bold; color: rgb(170, 0, 0); text-decoration: none; border: 0px none rgb(170, 0, 0); display: block; font-style: normal; font-variant: normal; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; height: 15px; outline: rgb(170, 0, 0) none 0px; padding: 0px; text-align: left; width: 1057.96875px; word-wrap: break-word;">开源中国-程序员在线工具：<a href="http://www.ostools.net/apidocs" style="text-decoration: none; border: 0px none rgb(68, 102, 187); color: rgb(68, 102, 187); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px; outline: rgb(68, 102, 187) none 0px; padding: 0px; text-align: left; word-wrap: break-word;">API文档大全(120+)</a> <a href="http://runjs.cn/" style="text-decoration: none; border: 0px none rgb(68, 102, 187); color: rgb(68, 102, 187); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px; outline: rgb(68, 102, 187) none 0px; padding: 0px; text-align: left; word-wrap: break-word;" target="_blank">JS在线编辑演示</a> <a href="http://www.ostools.net/qr" style="text-decoration: none; border: 0px none rgb(68, 102, 187); color: rgb(68, 102, 187); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px; outline: rgb(68, 102, 187) none 0px; padding: 0px; text-align: left; word-wrap: break-word;" target="_blank">二维码</a>  <a href="http://www.ostools.net/" style="text-decoration: none; border: 0px none rgb(68, 102, 187); color: rgb(68, 102, 187); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 13px; line-height: normal; font-family: Verdana, sans-serif, 宋体; margin: 0px; outline: rgb(68, 102, 187) none 0px; padding: 0px; text-align: left; word-wrap: break-word;" target="_blank">更多&gt;&gt;</a>
		      </p></div>
	</div></div></body></html>